import { Column, Entity, PrimaryGeneratedColumn, BaseEntity, CreateDateColumn, UpdateDateColumn, ManyToOne, DeleteDateColumn, } from 'typeorm';
import { GoodsCategory } from 'src/erp/goods-category/entities/goods-category.entity';
@Entity('erp_goods')
export class Goods extends BaseEntity {
    @PrimaryGeneratedColumn()
    id: number;
    @Column()
    name: string;
    @Column()
    number: string;
    @Column()
    spec: string;
    @Column('int')
    categoryId: number;
    @Column()
    unit: string;
    @DeleteDateColumn({ nullable: true }) // TypeORM 内置软删除字段
    deletedTime: Date;
    @Column('int')
    createAdminId: number;
    @CreateDateColumn({ type: 'timestamp', default: () => 'CURRENT_TIMESTAMP' })
    createTime: Date;
    @UpdateDateColumn({ type: 'timestamp', default: () => 'CURRENT_TIMESTAMP' })
    updateTime: Date;
    @ManyToOne(() => GoodsCategory, (category) => category.goods )
    category: GoodsCategory;
}
